package com.twh.www.mapper;

import com.twh.www.entity.WnUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


@Mapper
public interface WnUserMapper extends BaseMapper<WnUser> {
    @Select("SELECT * FROM wn_user WHERE account = #{account}")
    WnUser getUserByAccount(String account);

    @Select("SELECT * FROM wn_user WHERE telphone = #{phone}")
    WnUser getUserByPhone(String phone);

    @Select("SELECT * FROM wn_user WHERE email = #{email}")
    WnUser getUserByEmail(String email);

    @Update("update wn_user set status = #{status} where id = #{id}")
    int updateUserStatus(@Param("id") Integer id, @Param("status") String status);

    @Update("update wn_user set status = '4' where id = #{id}")
    int deleteUser(Integer id);
}




